package br.com.fsa.aplication.Database;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;

import br.com.fsa.aplication.Exception.ConectionException;
import br.com.fsa.aplication.Model.bean.Conhecimento;
import br.com.fsa.aplication.Util.HibernateUtil;

public class ConhecimentoDAO extends DaoGenericoImpl<Conhecimento> {
	
	public void update(Conhecimento objeto){
		Session session=null;
		Transaction t = null;
		try {
			session = HibernateUtil.getSession().openSession();
			t = session.beginTransaction();
			session.merge(objeto);
		} catch (HibernateException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ConectionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally{
			t.commit();
			session.close();
			
		}
				
	}

}
